package cn.edu.scau.cmi.front.domain;

import java.util.Date;

public class KnowledgeBaseItem {

	private String standardName;
	private String standardLevelName;
	private String standardTypeName;
	private Date effectiveDate;
	private Date expiryDate;
	private String featureName;
	private String unitName;
	private float minValue;
	private float maxValue;
	public String getStandardName() {
		return standardName;
	}
	public void setStandardName(String standardName) {
		this.standardName = standardName;
	}
	public String getStandardLevelName() {
		return standardLevelName;
	}
	public void setStandardLevelName(String standardLevelName) {
		this.standardLevelName = standardLevelName;
	}
	public String getStandardTypeName() {
		return standardTypeName;
	}
	public void setStandardTypeName(String standardTypeName) {
		this.standardTypeName = standardTypeName;
	}
	public Date getEffectiveDate() {
		return effectiveDate;
	}
	public void setEffectiveDate(Date effectiveDate) {
		this.effectiveDate = effectiveDate;
	}
	public Date getExpiryDate() {
		return expiryDate;
	}
	public void setExpiryDate(Date expiryDate) {
		this.expiryDate = expiryDate;
	}
	public String getFeatureName() {
		return featureName;
	}
	public void setFeatureName(String featureName) {
		this.featureName = featureName;
	}
	public String getUnitName() {
		return unitName;
	}
	public void setUnitName(String unitName) {
		this.unitName = unitName;
	}
	public float getMinValue() {
		return minValue;
	}
	public void setMinValue(float minValue) {
		this.minValue = minValue;
	}
	public float getMaxValue() {
		return maxValue;
	}
	public void setMaxValue(float maxValue) {
		this.maxValue = maxValue;
	}
	@Override
	public String toString() {
		return "KnowledgeBaseItem [standardName=" + standardName + ", standardLevelName=" + standardLevelName
				+ ", standardTypeName=" + standardTypeName + ", effectiveDate=" + effectiveDate + ", expiryDate="
				+ expiryDate + ", featureName=" + featureName + ", unitName=" + unitName + ", minValue=" + minValue
				+ ", maxValue=" + maxValue + "]";
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((effectiveDate == null) ? 0 : effectiveDate.hashCode());
		result = prime * result + ((expiryDate == null) ? 0 : expiryDate.hashCode());
		result = prime * result + ((featureName == null) ? 0 : featureName.hashCode());
		long temp;
		temp = Double.doubleToLongBits(maxValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(minValue);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + ((standardLevelName == null) ? 0 : standardLevelName.hashCode());
		result = prime * result + ((standardName == null) ? 0 : standardName.hashCode());
		result = prime * result + ((standardTypeName == null) ? 0 : standardTypeName.hashCode());
		result = prime * result + ((unitName == null) ? 0 : unitName.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		KnowledgeBaseItem other = (KnowledgeBaseItem) obj;
		if (effectiveDate == null) {
			if (other.effectiveDate != null)
				return false;
		} else if (!effectiveDate.equals(other.effectiveDate))
			return false;
		if (expiryDate == null) {
			if (other.expiryDate != null)
				return false;
		} else if (!expiryDate.equals(other.expiryDate))
			return false;
		if (featureName == null) {
			if (other.featureName != null)
				return false;
		} else if (!featureName.equals(other.featureName))
			return false;
		if (Double.doubleToLongBits(maxValue) != Double.doubleToLongBits(other.maxValue))
			return false;
		if (Double.doubleToLongBits(minValue) != Double.doubleToLongBits(other.minValue))
			return false;
		if (standardLevelName == null) {
			if (other.standardLevelName != null)
				return false;
		} else if (!standardLevelName.equals(other.standardLevelName))
			return false;
		if (standardName == null) {
			if (other.standardName != null)
				return false;
		} else if (!standardName.equals(other.standardName))
			return false;
		if (standardTypeName == null) {
			if (other.standardTypeName != null)
				return false;
		} else if (!standardTypeName.equals(other.standardTypeName))
			return false;
		if (unitName == null) {
			if (other.unitName != null)
				return false;
		} else if (!unitName.equals(other.unitName))
			return false;
		return true;
	}
}